﻿@using MvcApplication.Entity;
@model PaginationResult<Article>
@{
    ViewBag.Title = "采集库文章列表";
}
<style>
    table * {
        font-size: 13px;
    }
</style>
<div class="am-g" style="margin-top:5px;">
    <div class="am-u-sm-9">
        <table cellspacing="0" class="am-table">
            <thead>
                <tr>
                    <th>标题</th>
                    <th>分类</th>
                    <th>采集时间</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                @foreach (var article in Model.Datas)
                {
                    <tr>
                        <td><a  href="/article/index/@article.ID">@article.Title</a></td>
                        <td>@article.Classify.ToString()</td>
                        <td>@article.CollectAt.ToString("yyyy-MM-dd")</td>
                        <td>
                            @if (article.Posts.Count == 0)
                            {
                                <a href="/article/edittopost?articleid=@article.ID">编辑到正式库</a>
                            }
                            else
                            {
                                <span>已编辑</span> <a href="/post/edit/@article.Posts.FirstOrDefault().ID">编辑</a>
                            }
                        </td>
                    </tr>
                }
            </tbody>
        </table>
        @{Html.RenderPartial("~/Views/Common/Pagination.cshtml", Model);}
    </div>
    <div class="am-u-sm-3">
        <form action="" method="get" class="column">
            <select name="classify">
                <option value="">全部</option>
                @foreach (var value in Enum.GetValues(typeof(Classify)))
                {
                    var name = Enum.GetName(typeof(MvcApplication.Entity.Classify), value); 
                    <option value="@value">@name</option>
                }
            </select>
            <button type="submit">筛选</button>
        </form>
    </div>
</div>

